/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"57159877-4F86-4B15-A08A-511402D8AF71"}
 */
var busqueda_vendedor = "";

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"F0E5175D-3FE0-43AB-8C96-4DFBABCFB6FE"}
 */
function btn_alta_vendedor(event) {
		
		var win = application.createWindow(application.getUUID().toString(),JSWindow.MODAL_DIALOG);
		win.resizable = false;
		win.storeBounds = false;
		win.undecorated = false;
		
		forms.VENDEDOR_EDIT.controller.newRecord();
		forms.VENDEDOR_EDIT.elements.btn_baja.visible = false;
		forms.VENDEDOR_EDIT.elements.btn_volver.visible = false;
		forms.VENDEDOR_EDIT.elements.bnt_aceptar.visible = true;
		forms.VENDEDOR_EDIT.elements.btn_cancelar.visible = true;
		win.show(forms.VENDEDOR_EDIT);
		
		
	}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 *
 * @properties={typeid:24,uuid:"CA912474-7502-41EA-BF21-538C0DC280FE"}
 */
function btn_ver_ficha(event) {
	
	forms.Inicio.elements.tab_mostrar.removeAllTabs();
	forms.Inicio.elements.tab_mostrar.addTab(forms.VENDEDOR_FICHA);
	forms.VENDEDOR_EDIT.elements.bnt_aceptar.visible = false;
	forms.VENDEDOR_EDIT.elements.btn_cancelar.visible = false;
	forms.VENDEDOR_EDIT.elements.btn_volver.visible = true;
	forms.VENDEDOR_EDIT.elements.btn_baja.visible = true;

}

/**
 * @AllowToRunInFind
 * 
 * @param {Object} oldValue
 * @param {Object} newValue
 * @param {Object} event
 *
 * @properties={typeid:24,uuid:"CD6D01FC-D7D2-4FCC-A07F-BF45356F066A"}
 */
function onDataChange(oldValue, newValue, event) {

			if (forms.VENDEDOR_lst.foundset.find()){
				
				forms.VENDEDOR_lst.nombre = "#%" + busqueda_vendedor + "%";
				forms.VENDEDOR_lst.foundset.search();
				
				
				return true;
			}else
				return false;
				
				
		}
